<!DOCTYPE html>
<html ng-app="plunker">

<head>

	<jsp:include page="/page/header.jsp"></jsp:include>

</head>

<body ng-controller="admInserircredito">

    <div ng-include="'page/menu-include.jsp'"></div>


    <!-- modal login -->

    <div class="modal" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">

            <div class="modal-content">

                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">&times;</span><span class="sr-only">Fechar</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">Login</h4>
                </div>

                <div class="modal-body">

                    <form class="form-horizontal" action="login" method="post" name="myForm">

                        <div class="form-group">
                            <label for="inputEmail" class="control-label col-xs-2">Email</label>
                            <div class="col-xs-10">
                                <input type="email" class="form-control" id="inputEmail" placeholder="Email" name="user" ng-required="true">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="inputPassword" class="control-label col-xs-2">Senha</label>
                            <div class="col-xs-10">
                                <input type="password" class="form-control" id="inputPassword" placeholder="Senha" name="senha" ng-minlength="6" ng-required="true">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-xs-offset-2 col-xs-10">
                                <button type="submit" class="btn btn-primary" ng-click="limparCarrinho();" ng-disabled="myForm.$invalid">Login</button>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-xs-offset-2 col-xs-10">
                                <label><a href="page/usuario.html">CADASTRE-SE</a>||<a href="page/recuperarSenha.html">Esqueci minha senha</a>
                                </label>
                            </div>
                        </div>
                    </form>

                </div>

            </div>
        </div>
    </div>

    <!-- modal login (fim) -->

    <div id="main" class="container clear-top intForm intForm">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">Liberar Saque</h3>
            </div>
            <div class="panel-body">
                <span>{{mensagem}}</span>
                <form class="form-horizontal" name="myForm">
                    <div class="form-group">
                        <label for="inputCPF" class="control-label col-xs-2">CPF</label>
                        <div class="col-xs-7">
                            <input id="inputCPF" type="text" ng-model="cpf" class="form-control" ng-required="true" ng-cpf ui-mask="999.999.999-99">
                        </div>
                        <button class="btn btn-primary" ng-click="carregarUsuario();">Buscar</button>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-2">Id usuario</label>
                        <div class="col-xs-9">
                            <input id="inputId" ng-model="idUsuario" class="form-control" ng-disabled="true">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputNome" class="control-label col-xs-2">Nome</label>
                        <div class="col-xs-9">
                            <input id="inputNome" ng-model="nome" class="form-control" ng-disabled="true">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail" class="control-label col-xs-2">Email</label>
                        <div class="col-xs-9">
                            <input type="email" id="inputEmail" ng-model="email" class="form-control" ng-disabled="true">
                        </div>
                    </div>
                </form>
                <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <th>Id. Pagamento</th>
                            <th>Tipo de Pagamento</th>
                            <th>Status</th>
                            <th>Data Inserçao</th>
                            <th>Data Liberação</th>
                            <th>Valor</th>
                            <th>Ação</th>
                        </tr>
                    </thead>
                    <tbody ng-repeat="pagamento in pagamentos">
                        <tr ng-show="pagamento.tipoPagamento == 'Saque'">
                            <th>{{pagamento.idPagamento}}</th>
                            <th>{{pagamento.tipoPagamento}}</th>
                            <td>{{getStatusPagamento(pagamento.statusDePagamento)}}</td>
                            <th>{{pagamento.dtInsercao}}</th>
                            <th>{{pagamento.dtPagamento}}</th>
                            <td>{{pagamento.valor | currency : 'R$'}}</td>
                            <td>
                                <button class="btn btn-primary" ng-click="liberarSaque(pagamento.idPagamento)" ng-disabled="!(pagamento.dtPagamento == '-')">Liberar</button>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    </div>

    <!-- inicio footer -->


    <footer class="footer ng-scope clearfix">

        <div class="footer-top">
            <h3>Formas de pagamento</h3>
            <img src="img/pagamento.png">
        </div>


        <div class="footer-bottom">
            <div class="in-footer clearfix">
                <span class="pull-left">© 2014 | Mega Acerto</span>
                <ul class="pull-right social list-inline">
                    <li>
                        <a href="#">
                            <img src="img/face.png">
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <img src="img/twitter.png">
                        </a>
                    </li>
                </ul>
            </div>
        </div>


    </footer>

    <jsp:include page="/page/scripts.jsp"/>
    
</body>

</html>